package com.ruoyi.warning.domain.vo;


import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.core.base.Field;
import com.ruoyi.warning.domain.entity.Device;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 区域vo
 * </p>
 *
 * @author chenhc
 * @since 2025-02-06
 */
@Data
@SuppressWarnings("serial")
@ApiModel("区域vo")
public class AreaVO extends Field {
    /**
     * 区域id
     */
    @TableId
    private String areaCode;

    /**
     * 区域名称
     */
    private String name;

    private String parentIndexCode;

    private String isUsed;

    @ApiModelProperty("区域的子集")
    private List<AreaVO> areaList = new ArrayList<>();

    @ApiModelProperty("区域下的设备")
    private List<Device> deviceList;

    // 添加子节点
    public void addChild(AreaVO child) {
        this.areaList.add(child);
    }
}
